﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Publish.aspx.cs" Inherits="TulingBuy.CRM.Web.Pages.DataPages.Publish" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="/_css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/_css/common.css" rel="stylesheet" type="text/css" />
    <link href="/_css/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="/_css/bootstrap-select.min.css" rel="stylesheet" />
    <script src="/_js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/_js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/_js/bootstrap-select.min.js"></script>
    <script src="/_js/json2.js" type="text/javascript"></script>
    <script src="/_js/common.js" type="text/javascript"></script>
    <style>
        button {
            float: right;
        }

        li {
            clear: both;
        }


    </style>
    <script>
        window.onload = function () {
            getEntityList();
            //$('.selectpicker').selectpicker({
            //    //style: 'btn-info'
            //    liveSearch: true
            //});
            
        }

        function getEntityList() {
            $.ajax(
                    {
                        url: "/Service/Entity/GetEntityList.ashx",
                        type: "post",
                        dataType: "json",
                        data: {

                        },
                        success: function (data, textStatus) {
                            //console.log(JSON.stringify(data));
                            var str = "";
                            str += '<select id="" class="selectpicker show-menu-arrow form-control bs-select-hidden" multiple="" data-max-options="100">';
                            for (var i = 0; i < data.length; i++) {
                                var item = data[i];
                                //str += "<option value='" + item.EntityName + "'>" + item.EntityDisplayName + "</option>";
                                str += "<option value='" + item.EntityMapId + "' entityname=" + item.EntityName + ">" + item.EntityDisplayName + "</option>";
                                //str += "<option>" + item.EntityDisplayName + "</option>";
                            }
                            str += '</select>';
                            //console.log(str);
                            $("#entity_select_div").html(str);
                            //$("#select_1").append(str);
                            $('.selectpicker').selectpicker({
                                //style: 'btn-info'
                                liveSearch: true,
                                header: "请选择新增/修改的实体:"
                            });
                        },
                        error: function (data, textStatus) {
                            $.toast("获取实体信息失败");
                        }
                    }
                );
        }


        function add_entity() {
            var entitylist = new Array();
            $("#entity_select_div option:selected").each(function () {
                //console.log($(this).val() + ":" + $(this).text() + ":" + $(this).attr("entityname"));
                entitylist.push($(this).attr("entityname"));
            });
            console.log(JSON.stringify(entitylist));
            $.ajax(
                {
                    url: "/Service/Data/GetPublishData.ashx",
                    type: "post",
                    dataType: "json",
                    data:{
                        type: "2",
                        entitylist:entitylist
                    },
                    success: function (data) {
                        console.log(JSON.stringify(data));
                    },
                    error: function (e) {
                        $.toast(JSON.stringify(e));
                    }
                }
            );

        }

    </script>
</head>
<body>
    <select id="select_1">
        
    </select>
    <div class="col-md-12">
        <h3>(要发布的具体名称name)-(owinguser谁)发布</h3>
        <hr />
        <div>
            <div style="width: 1000px">
                <button>下载</button>
                <button>导入</button></div>
            <div style="width: 1000px; clear: both">
                <ul>
                    <li><span>1.站点图</span>
                        <button id="TLM_sitemapid">添加</button></li>
                    <li><span>2.实体</span>
                        <button id="TLM_entityid_btn">添加</button></li>
                    <li><span>3.JS资源</span>
                        <button id="TLM_jsresources">添加</button></li>
                    <li><span>4.存储过程</span>
                        <button id="TLM_storageprocessid">添加</button></li>
                    <li><span>5.数据库触发器</span>
                        <button id="TLM_triggerid">添加</button></li>
                    <li><span>6.角色权限</span>
                        <button id="TLM_rolepowerid">添加</button></li>
                    <li><span>7.功能权限</span>
                        <button id="	TLM_functionpowerid">添加</button></li>
                    <li><span>8.服务器触发器</span>
                        <button id="TLM_pluginid">添加</button></li>
                    <li><span>9.同步服务</span>
                        <button id="TLM_synchronizeserviceid">添加</button></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="col-md-12">
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse1"><span>1.站点图</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse1" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse2"><span>2.实体</span>
                        </a>
                        <button class="btn btn-default" style="float:right;" onclick="add_entity();"><span>添加</span></button>

                    </h4>
                </div>
                <div id="collapse2" class="panel-collapse collapse in">
                    <div id="entity_select_div" class="panel-body">
<%--                        <select id="entity_select" class="selectpicker show-menu-arrow form-control bs-select-hidden" multiple="" data-max-options="100" >
                            <option>chicken</option>
                            <option>turkey</option>
                            <option>goose</option>
                            <option>goose</option>
                            <option>goose</option>
                            <option>goose</option>
                            <option>aaaa</option>
                        </select>--%>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse3"><span>3.JS资源</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse3" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse4"><span>4.存储过程</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse4" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>

        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse5"><span>5.数据库触发器</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse5" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse6"><span>6.角色权限</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse6" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse7"><span>7.功能权限</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse7" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse8"><span>8.服务器触发器</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse8" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                            href="#collapse9"><span>9.同步服务</span>
                        </a>
                    </h4>
                </div>
                <div id="collapse9" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Nihil anim keffiyeh helvetica, craft beer labore wes anderson 
				cred nesciunt sapiente ea proident. Ad vegan excepteur butcher 
				vice lomo.
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
